
/*
 *
 *  Copyright (C) 2012-2024
 *  All rights reserved, Designed By 杭州连线客信息技术有限公司
 *  注意：
 *  本软件为杭州连线客信息技术有限公司开发研制，未经购买不得使用
 *  购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
 *  一经发现盗用、分享等行为，将追究法律责任，后果自负
 *
 */

package com.lxk.oms.order.domain.bo;

import com.lxk.oms.order.domain.OmsOrder;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 订单业务对象 oms_order
 *
 * @author LXK-RY5
 * @date 2024-08-20
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = OmsOrder.class, reverseConvertGenerate = false)
public class OmsOrderBo extends BaseEntity {

    /**
     * ID
     */
    @NotNull(message = "ID不能为空", groups = {EditGroup.class})
    private Long id;


    /**
     * 订单名称
     */
    private String orderName;

    /**
     * 商户id
     */
    @NotNull(message = "商户id不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long merId;

    /**
     * 订单编号
     */
    @NotBlank(message = "订单编号不能为空", groups = {AddGroup.class, EditGroup.class})
    private String orderNo;

    /**
     * 订单类型 0=普通订单
     */
    @NotNull(message = "订单类型 0=普通订单不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer orderType;

    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long userId;

    /**
     * 用户下单IP
     */
    @NotBlank(message = "用户下单IP不能为空", groups = {AddGroup.class, EditGroup.class})
    private String userIp;

    /**
     * 用户备注
     */
    private String userRemark;

    /**
     * 商家备注
     */
    private String merRemark;

    /**
     * 平台备注
     */
    private String platformRemark;

    /**
     * 订单状态， 0=创建等待支付   100=支付中 200=支付成功  300=待发货待配送  400=确认收货/配送完成 500=用户取消订单  501=超时未支付取消 502=商家取消订单
     */
    @NotNull(message = "订单状态， 0=创建等待支付   100=支付中 200=支付成功  300=待发货待配送  400=确认收货/配送完成 500=用户取消订单  501=超时未支付取消 502=商家取消订单不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer status;

    /**
     * 订单金额
     */
    @NotNull(message = "订单金额不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal totalPrice;

    /**
     * 订单优惠金额
     */
    @NotNull(message = "订单优惠金额不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal discountPrice;

    /**
     * 应付金额=订单金额-订单优惠金额
     */
    @NotNull(message = "应付金额=订单金额-订单优惠金额不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal payPrice;

    /**
     * 实际支付金额，一般等于应付金额， 用于拍下商家改价场景
     */
    @NotNull(message = "实际支付金额，一般等于应付金额， 用于拍下商家改价场景不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal actPayPrice;

    /**
     * 是否已支付：0=未支付 1=已支付
     */
    @NotNull(message = "是否已支付：0=未支付 1=已支付不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer payStatus;

    /**
     * 订单支付时间
     */
    @NotNull(message = "订单支付时间不能为空", groups = {EditGroup.class})
    private Date payTime;

    /**
     * 支付订单编号
     */
    @NotBlank(message = "支付订单编号不能为空", groups = {EditGroup.class})
    private String payOrderSn;

    /**
     * 支付方式 微信=WX, ALIPAY=支付宝
     */
    @NotBlank(message = "支付方式 微信=WX, ALIPAY=支付宝不能为空", groups = {EditGroup.class})
    private String payType;

    /**
     * 订单完成时间
     */
    @NotNull(message = "订单完成时间不能为空", groups = {EditGroup.class})
    private Date finishTime;

    /**
     * 取消理由
     */
    @NotBlank(message = "取消理由不能为空", groups = {EditGroup.class})
    private String cancelReason;

    /**
     * 订单取消时间
     */
    @NotNull(message = "订单取消时间不能为空", groups = {EditGroup.class})
    private Date cancelTime;

    /**
     * 发货时间
     */
    @NotNull(message = "发货时间不能为空", groups = {EditGroup.class})
    private Date deliveryTime;

    /**
     * 收货时间
     */
    @NotNull(message = "收货时间不能为空", groups = {EditGroup.class})
    private Date receiveTime;

    /**
     * 联系人名称
     */
    @NotBlank(message = "联系人名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String receiverName;

    /**
     * 联系人手机
     */
    @NotBlank(message = "联系人手机不能为空", groups = {AddGroup.class, EditGroup.class})
    private String receiverMobile;

    /**
     * 联系人详细地址
     */
    @NotBlank(message = "联系人详细地址不能为空", groups = {AddGroup.class, EditGroup.class})
    private String receiverDetailAddress;

    /**
     * 订单省份ID
     */
    @NotNull(message = "订单省份ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long orderProvinceId;

    /**
     * 订单省份名称
     */
    @NotBlank(message = "订单省份名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String orderProvinceName;

    /**
     * 订单城市ID
     */
    @NotNull(message = "订单城市ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long orderCityId;

    /**
     * 订单城市名称
     */
    @NotBlank(message = "订单城市名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String orderCityName;

    /**
     * 订单区县ID
     */
    @NotNull(message = "订单区县ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long orderDistrictId;

    /**
     * 订单区县名称
     */
    @NotBlank(message = "订单区县名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String orderDistrictName;

    /**
     * 用户删除标识（0未删 2已删）
     */
    @NotNull(message = "用户删除标识", groups = {EditGroup.class})
    private String userDelFlag;

    /**
     * 商家删除标识（0未删 2已删）
     */
    @NotNull(message = "商家删除标识（0未删 2已删）不能为空", groups = {AddGroup.class, EditGroup.class})
    private String merDelFlag;

    /**
     * 分账开始时间
     */
    @NotNull(message = "分账开始时间不能为空", groups = {EditGroup.class})
    private Date divideStartTime;

    /**
     * 分账状态（0无需分账 1未分账 2待分账 3分账中 4分账失败 5分账完成）
     */
    @NotNull(message = "分账状态（0无需分账 1未分账 2待分账 3分账中 4分账失败 5分账完成）不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer divideStatus;

    /**
     * 分账完成时间
     */
    @NotNull(message = "分账完成时间不能为空", groups = {EditGroup.class})
    private Date divideCompleteTime;

    /**
     * 退款金额
     */
    @NotNull(message = "退款金额不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal refundAmount;

    /**
     * 退款状态（0未退款 1部分退款 2全部退款）
     */
    @NotNull(message = "退款状态（0未退款 1部分退款 2全部退款）不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer refundStatus;

    /**
     * 售后状态（0未售后 1售后中 2已售后）
     */
    @NotNull(message = "售后状态（0未售后 1售后中 2已售后）不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer postStatus;

    /**
     * 物流公司编码
     */
    @NotBlank(message = "物流公司编码不能为空", groups = {EditGroup.class})
    private String shipperCode;

    /**
     * 物流单号
     */
    @NotBlank(message = "物流单号不能为空", groups = {EditGroup.class})
    private String deliverySn;

    /**
     * 物流名称
     */
    @NotBlank(message = "物流名称不能为空", groups = {EditGroup.class})
    private String deliveryName;

    /**
     * 订单成本总价
     */
    @NotNull(message = "订单成本总价不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal orderCostPrice;

    /**
     * 订单市场总价
     */
    @NotNull(message = "订单市场总价不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal orderMarkerPrice;

    /**
     * 订单利润=totalPrice-orderCostPrice
     */
    @NotNull(message = "订单利润不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal orderProfitPrice;


    /**
     * 支付积分
     */
    private BigDecimal payPoint;

    /**
     * 0=快递物流, 1=商家配送 2=用户自提
     */
    private Integer deliveryType;


    /**
     * 商户的订单号
     */
    private String outTradeNo;


    /**
     * 是否扣减库存 0=需要 1=不需要
     */
    private Integer needStock;

    /**
     * 实收款
     */
    private BigDecimal actReceiveAmount;

    /**
     * 合并订单单号
     */
    private String combineOutTradeNo;

}
